import request from '@/utils/request'

// 根据父级查询子级
export function getByPid(pid) {
  return request({
    url: '/system/menu/getByPid/' + pid,
    method: 'get',
    dataType: 'json',
    headers: {
      'urlType':'admin'
    }
  })
}

export function getByRoleId(roleId) {
  return request({
    url: '/system/menu/getByRoleId/' + roleId,
    method: 'get',
    dataType: 'json',
    headers: {
      'urlType':'admin'
    }
  })
}

export function getByIdMoreDetail(dataId) {
  return request({
    url: '/system/menu/getByIdMoreDetail/' + dataId,
    method: 'get',
    dataType: 'json',
    headers: {
      'urlType':'admin'
    }
  })
}

// 分页查询实体集合
export function queryForList(params) {
  return request({
    url: '/system/menu/queryForList',
    contentType: 'application/json;charset=utf-8',
    method: 'post',
    dataType: 'json',
    data: params,
    headers: {
      'urlType':'admin'
    }
  })
}

export function createOrUpdate(params) {
  return request({
    url: '/system/menu/createOrUpdate',
    contentType: 'application/json;charset=utf-8',
    method: 'post',
    dataType: 'json',
    data: params,
    headers: {
      'urlType':'admin'
    }
  })
}

export function handleRoleMenu(params) {
  return request({
    url: '/system/menu/handleRoleMenu',
    contentType: 'application/json;charset=utf-8',
    method: 'post',
    dataType: 'json',
    data: params,
    headers: {
      'urlType':'admin'
    }
  })
}

export function deleteData(dataId) {
  return request({
    url: '/system/menu/delete/' + dataId,
    method: 'post',
    dataType: 'json',
    headers: {
      'urlType':'admin'
    }
  })
}